//
//  HomeTopBar.swift
//  Keep1
//
//  Created by 王志涛 on 2021/3/3.
//

import SwiftUI

struct HomeTopBar: View {
    @State var presentSearchPage : Bool = false
    
    var body: some View {
        HStack{
            Text("首页")
                .font(.title2)
                .fontWeight(.black)
            Spacer()
            Button(action: {
                self.presentSearchPage = true
            }, label: {
                Image(systemName: "magnifyingglass")
                    .font(.title2)
            })
            .fullScreenCover(isPresented: $presentSearchPage, content: {
                Search(presentSearchPage: $presentSearchPage)
            })
        }
        .foregroundColor(.black)
        .padding(.horizontal, 18)
        .background(Color.white)
    }
}

struct HomeTopBar_Previews: PreviewProvider {
    static var previews: some View {
        HomeTopBar()
    }
}
